package com.yly.input.demo.converter;

import com.yly.input.demo.bo.ElderBO;
import com.yly.input.demo.dto.ElderDTO;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;

/**
 * 客户端入参转换 DTO-> BO
 */
@Service
public class ControllerConverter {

    public ElderBO toElderBO(ElderDTO elderDTO) {
        if (elderDTO == null) {
            return null;
        }

        ElderBO elderBO = new ElderBO();
        BeanUtils.copyProperties(elderDTO, elderBO);

        return elderBO;
    }

}
